<template>
	<view class="wrapper">
		<view class="header">
			<view class="action">
				<view class="left">
					<view class="action-li">
						<image src="../../static/user/user/action1.png"></image>
					</view>
				</view>
				<view class="right">
					<view class="action-li">
						<image src="../../static/user/user/action3.png"></image>
					</view>
					<view class="action-li"  @tap="jumpNavigateTo('/pages/user/setting')">
						<image src="../../static/user/user/action2.png"></image>
					</view>
				</view>
			</view>
			<view class="userinfo">
				<view class="left">
					<view class="avatar">
						<image :src="username.avatar"></image>
					</view>
					
					<view class="username" v-if="token == ''"  @tap="jumpNavigateTo('/pages/user/login')">登录/注册</view>
					<view  class="username" v-else>
						<view style="font-size: 26rpx;">{{username.nickname}}</view>
						<view style="font-size: 20rpx; color: #999; font-weight: 200; margin-top: 15rpx;">{{newPhone}}</view>
					</view>
				</view>
				<view class="right">
					<view class="bg">
						<image src="../../static/user/user/bg.png"></image>
					</view>
				</view>
			</view>
		</view>
		<view class="block" v-if="token == ''"  >
			<view class="title">
				<view class="left">极速开户</view>
				<view class="right">已有帐户直接登录<uni-icons type="right" size="15" color="#999999"></uni-icons></view>
			</view>
			<view class="image">
				<image src="../../static/user/user/block1.png" mode="widthFix"></image>
			</view>
		</view>
		<view v-else>
			<view class="zican">
				<view class="zican_a">
					<view style="width: 345rpx; height: 67rpx; float: right; position: relative;">
						<image src="../../static/jx.png" style="width: 100%; height: 100%;"></image>
						<view style="position: absolute; left: 0; width: 100%; height: 67rpx; top: 0; font-size: 22rpx; line-height: 67rpx; text-align: center;">当前账号{{username.fund_account}}</view>
					</view>
					<view style="float: left; margin-left: 5%; font-size: 24rpx; margin-top: 30rpx; color: #999;">全景资产(元)</view>
					<view style="width: 100%; float: left; margin-left: 30rpx; margin-top: 30rpx;  font-weight: 600;">{{username.money}}</view>
					<view style="width: 90%; float: left; margin-left: 5%; margin-top: 30rpx;  color: #999; font-size: 22rpx;">
						<view style="float: left; width: 50%;">股票： <text style="font-size: 26rpx; color: #000; font-weight: 600;">0.00</text></view>
						<view style="float: left; width: 50%;">债劵：<text style="font-size: 26rpx; color: #000; font-weight: 600;">0.00 </text></view>
					</view>
					<view style="width: 90%; float: left; margin-left: 5%; margin-top:10rpx;  color: #999; font-size: 22rpx;">
						<view style="float: left; width: 50%;">理财： <text style="font-size: 26rpx; color: #000; font-weight: 600;">0.00</text></view>
						<view style="float: left; width: 50%;">资金：<text style="font-size: 26rpx; color: #000; font-weight: 600;">{{username.money}} </text></view>
					</view>
					<view style="width: 100%; height: 50rpx; border-top: 1rpx solid #E5E5E5; float: left; margin-top: 10rpx;">
						<view style="width: 20rpx; height: 20rpx; float: left; margin-top: 30rpx; border: 4rpx solid #08377D; border-radius: 100%; margin-left: 30rpx;"></view>
						<view style="width: 80%; height: 100%; line-height: 90rpx; font-size: 24rpx; margin-left: 20rpx; float: left;">上周投资周报已出，去复盘下吧~</view>
					     <image src="../../static/fanhui.png" style="width: 10rpx; height: 20rpx; float: right; margin-top: 35rpx; margin-right: 30rpx;"></image>
					</view>
					
				</view>
				<image src="../../static/jskh.png" style="width: 90%; height: 148rpx; float: left; margin-left: 5%; margin-top:30rpx;"></image>
			</view>
			<view style="width: 100%; height: 32rpx; background: #F6F4F9;"></view>
		</view>
		<view class="business">
			<view class="title">
				<image src="../../static/user/user/title-business.png"></image>
			</view>
			<view class="info-business">
				<view class="info" @tap="jumpNavigateTo('/pages/user/mysetting')">
					<image src="../../static/user/user/info1.png"></image>
					<view class="business-name">个人信息</view>
				</view>
				<view class="info" @tap="jumpNavigateTo('/pages/user/money')">
					<image src="../../static/user/user/info2.png"></image>
					<view class="business-name">安全管理</view>
				</view>
				<view class="info" @tap="jumpNavigateTo('/pages/user/card')">
					<image src="../../static/user/user/info3.png"></image>
					<view class="business-name">大宗交易</view>
				</view>
				<view class="info" @tap="jumpNavigateTo('/pages/user/openaccount')">
					<image src="../../static/user/user/info4.png"></image>
					<view class="business-name">风险评测</view>
				</view>
				<view class="info" @tap="jumpNavigateTo('/pages/user/login')">
					<image src="../../static/user/user/info5.png"></image>
					<view class="business-name">三方存管</view>
				</view>
			</view>
		</view>
		<view class="list">
			<view class="listurl">
				<view class="left"  @tap="jumpNavigateTo('/pages/user/resettingpassword')">客服中心</view>
				<view class="right">24小时为您服务<uni-icons type="right" size="18" color="#999999"></uni-icons></view>
			</view>
			<view class="listurl">
				<view class="left" @tap="jumpNavigateTo('/pages/user/messagecenter')">客服热线</view>
				<view class="right"><uni-icons type="right" size="18" color="#999999"></uni-icons></view>
			</view>
			<view class="listurl" @tap="jumpNavigateTo('/pages/user/agreement/agreement')">
				<view class="left">隐私说明</view>
				<view class="right"><uni-icons type="right" size="18" color="#999999"></uni-icons></view>
			</view>
			<view class="listurl" @tap="jumpNavigateTo('/pages/user/agreement/agreement')">
				<view class="left">用户协议</view>
				<view class="right"><uni-icons type="right" size="18" color="#999999"></uni-icons></view>
			</view>
		</view>
		<view class="empty"></view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title: 'Hello',
				token:'',
				username:'',
				newPhone:'',
			}
		},
		onLoad() {
	      this.info()
		  this.token = uni.getStorageSync("token")
		},
		methods: {
			info(){
				this.$rqt.info().then(res => {
				  this.username = res.data.user
				  var phone= this.username.mobile
				  this.newPhone= phone.substr(0,3)+"****"+phone.substr(7);
						
				})
			},
			
			jumpNavigateTo(url) {
				uni.navigateTo({
					url: url
				})
			}
		}
	}
</script>

<style lang="scss">
	page{
		width: 100%;
		height: 100%;
		background-color: #F6F4F9;
	}
	.wrapper {
		height: 100%;
		box-sizing: border-box;
	}
	.header{
		padding: 60rpx 33rpx 22rpx;
		margin-bottom: 32rpx;
		background-color: #fff;
		border-radius: 12rpx;
		
		.action{
			width: 100%;
			height: 35rpx;
			display: flex;
			justify-content: space-between;
			margin-bottom: 18rpx;
			
			.right{
				display: flex;
				justify-content: flex-end;
				.action-li{
					margin-left:  24rpx;
				}
			}
			
			image{
				width: 35rpx;
				height: 35rpx;
			}
		}
		
		.userinfo{
			display: flex;
			justify-content: space-between;
			align-items: center;
			
			.left{
				display: flex;
				justify-content: flex-start;
				align-items: center;

				.avatar{
					width: 120rpx;
					height: 120rpx;
					margin-right: 32rpx;
					image{
						width: 100%;
						height: 100%;
						border-radius: 50%;
					}
				}
				
				.username{
					font-weight: bold;
					font-size: 32rpx;
					color: #262626;
				}
			}
			.right{
				.bg{
					width: 146rpx;
					height: 174rpx;
					image{
						width: 100%;
						height: 100%;
					}
				}
			}
		}
	}
	.zican{
		width: 100%;
		height: 604rpx;
		background: #fff;
	}
	.zican_a{
		width: 90%;
		height: 354rpx;
		background: #F6F6FB;
		border-radius: 20rpx;
		margin-left: 5%;
		float: left;
		margin-top: 32rpx;
	}
	.block{
		width: 100%;
		padding: 32rpx 33rpx;
		margin-bottom: 32rpx;
		box-sizing: border-box;
		background-color: #fff;
		border-radius: 12rpx;
		.title{
			display: flex;
			justify-content: space-between;
			align-items: center;
			.left{
				font-weight: bold;
				font-size: 32rpx;
				color: #262626;
			}
			.right{
				font-weight: 500;
				font-size: 24rpx;
				color: #999999;
			}
		}
		.image{
			width: 100%;
			height: auto;
			margin-top: 35rpx;
			image{
				width: 100%;
				height: auto;
			}
		}
	}
	.business{
		width: 100%;
		padding: 32rpx 33rpx;
		margin-bottom: 32rpx;
		box-sizing: border-box;
		background-color: #fff;
		border-radius: 12rpx;
		.title{
			width: 130rpx;
			height: 30rpx;
			image{
				width: 100%;
				height: 100%;
			}
		}
		.info-business{
			margin-top: 32rpx;
			display: flex;
			justify-content: space-between;
			text-align: center;
			.info{
				font-weight: 500;
				font-size: 24rpx;
				color: #999999;
				
				image{
					width: 80rpx;
					height: 80rpx;
					margin-bottom: 23rpx;
				}
			}
		}
	}
	.list{
		width: 100%;
		padding: 0 33rpx;
		margin-bottom: 32rpx;
		box-sizing: border-box;
		background-color: #fff;
		border-radius: 12rpx;
		.listurl{
			display: flex;
			justify-content: space-between;
			align-items: center;
			height: 93rpx;
			border-bottom: 1rpx solid #E5E5E5;
			.left{
				font-weight: bold;
				font-size: 32rpx;
				color: #262626;
			}
			.right{
				display: flex;
				align-items: center;
				font-weight: 500;
				font-size: 24rpx;
				color: #999999;
			}
		}
	}
	.empty{
		width: 100%;
		height: 100rpx;
	}
</style>